using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Mapping.Attributes;
using Lib;

namespace Persistance.Model
{
    [Serializable]
    [Class(Lazy = true)]
    public class Locations
    {

        private int _locationID;
        //NHIBER: Setts the primary key to ID
        [Id(Name = "LocationID")]
        [Generator(1, Class = "native")]
        public virtual int LocationID
        {
            get { return _locationID; }
            set { _locationID = value; }
        }

        private string _locationName;
        [Property(Length = 500)]
        public virtual string LocationName
        {
            get { return _locationName; }
            set { _locationName = value; }
        }

        private IList<Items> _items;
        [Bag(1, Inverse = true)]
        [Key(2, Column = "ItemID", ForeignKey = "CategoriesToItems")]
        [OneToMany(3, ClassType = typeof(Items))]
        public virtual IList<Items> Items
        {
            get { return _items; }
            set { _items = value; }
        }

    }
    
}
